How can I optimize my greedy knapsack algorithm for better performance in Python

join shbcf.ru